import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    ld = LaunchDescription()

    # hand_driver_package = get_package_share_directory('hand_driver')
    # config_file = os.path.join(hand_driver_package, 'config', 'motor_config.yaml')

    config_file = '/home/neousys/Works/ros2_ws/install/hand_driver/share/hand_driver/config/motor_config.yaml'

    print(config_file)

    hand_driver_node = Node(
        package='hand_driver',
        executable='hand_driver_node',
        name='hand_driver_node',
        parameters=[config_file]
    )

    # return LaunchDescription([
    #     hand_driver_node
    # ])
    ld.add_action(hand_driver_node)
    return ld
